﻿package chenji.moreitemfunapi.textures.plm;

import org.bukkit.Bukkit;
import org.bukkit.entity.Player;
import org.bukkit.plugin.messaging.PluginMessageListener;

import chenji.moreitemfunapi.MifAPI;

public class PLMListener implements PluginMessageListener {
	public PLMListener() {
		Bukkit.getMessenger().registerOutgoingPluginChannel(MifAPI.getPlugin(MifAPI.class), "mifhelper");
		Bukkit.getMessenger().registerIncomingPluginChannel(MifAPI.getPlugin(MifAPI.class), "mifhelper", this);
	}

	@Override
	public void onPluginMessageReceived(String arg0, Player arg1, byte[] arg2) {
		if (MifAPI.getTexturesUpdateManager().contain(arg1)) {
		} else {
			arg1.sendMessage("§a[MIFAPI]§c无效的上传");
		}
		MifAPI.getPluginMessageManager().receivePackage(arg2,arg1);
	}
}
